﻿@*
    生成者：admin
    生成时间：2021/6/23 18:05:16
    代码由代码生成器自动生成，更改的代码可能被进行替换
    界面如需更改，建议直接将内容剪切到自己的文件内，保留此空白文件
    用户列表
*@
@page "/User/Index"
@using Caviar.Models
@inherits IndexComponentBase<ViewUser>
@namespace Caviar.AntDesignPages.Pages.User
<CavTableTemplate TData="ViewUser"
                  DataSource="DataSource"
                  PageSize="PageSize"
                  PageIndex="PageIndex"
                  Total="Total"
                  Buttons="Buttons"
                  Query="Query"
                  ViewModelFields="ViewModelFields"
                  MappingQuery="MappingQuery"
                  PageIndexChanged="PageIndexChanged"
                  RowCallback="RowCallback"
                  Loading="Loading"
                  FuzzyQueryCallback="FuzzyQueryCallback"
                  GetQueryItems="GetQueryItem">

</CavTableTemplate>

@code{

    RenderFragment GetQueryItem(string key)
    {
        RenderFragment render = null;
        switch (key)
        {
            case "UserGroupName":
            case "UserGroupId":
                render = @<CavUserGroup DataSource="ViewUserGroups"
                                        OnSelect="e => EventRecord(e,key)"
                                        UserGroupName="@UserGroupName"
                                        OnCancel="()=>RemoveRecord(key)">
                        </CavUserGroup>;
                break;
            default:
                break;
        }


        return render;
    }

}